interface IShapePrototype {
  move: (x: number, y: number) => void;
}
interface IShape extends IShapePrototype {
  x: number;
  y: number;
}

const ShapePrototype: IShapePrototype = {
  move(x: number, y: number): void {
    this.x += x;
    this.y += y;
  }
};
function NewShape(): IShape {
  const instance = Object.create(ShapePrototype);
  instance.x = 0;
  instance.y = 0;
  return instance;
}



interface IRectanglePrototype {
}
interface IRectangle extends IShape, IRectanglePrototype {
}

const RectanglePrototype: IRectanglePrototype = Object.create(ShapePrototype);
function NewRectangle(): IRectangle {
  return  Object.assign(Object.create(RectanglePrototype), NewShape());
}
